string.insert c#

67

c# insert character into string at position -

//Insert method returns a copy, it does not alter the string since strings are immutable
string str = "abc";
str = str.Insert(2, "XYZ"); //str == "abXYZc"

Comments

Submit
0 Comments